home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1997 January / Macworld (1997-01).dmg / Shareware World / Comms & Internet / Eudora Share / Eudora Share Install next >
Text File  |  1996-09-18  |  3KB  |  100 lines

  1. script switch
  2.     on switchFile(myName, otherName)
  3.         tell application "Finder"
  4.             try
  5.                 set auxFolder to folder "Eudora Share:Alt Settings" of system folder
  6.             on error
  7.                 error "Please run the Installer first."
  8.             end try
  9.             try
  10.                 set euFolder to folder "Eudora Folder" of system folder
  11.             on error
  12.                 error "It seems Eudora is not installed in this computer."
  13.             end try
  14.             repeat with currentFile in (get files in auxFolder)
  15.                 if currentFile ends with myName then
  16.                     copy the name of currentFile to nameFile
  17.                     copy (characters 1 thru ((the offset of myName in nameFile) - 2) of nameFile) as string to realFile
  18.                     copy realFile & " " & otherName to otherFile
  19.                     move file realFile of euFolder to auxFolder
  20.                     set name of item realFile of auxFolder to otherFile
  21.                     move currentFile to euFolder
  22.                     set name of item nameFile of euFolder to realFile
  23.                 end if
  24.             end repeat
  25.         end tell
  26.     end switchFile
  27. end script
  28.  
  29. script e1
  30.     set seu to (path to system folder as string) & "Eudora Share:switch Eudora"
  31.     copy (load script file seu) to switchFiles
  32.     tell switchFiles
  33.         switchFile("1", "2")
  34.     end tell
  35.     tell application "Eudora"
  36.         run
  37.     end tell
  38. end script
  39.  
  40. script e2
  41.     set seu to (path to system folder as string) & "Eudora Share:switch Eudora"
  42.     copy (load script file seu) to switchFiles
  43.     tell switchFiles
  44.         switchFile("2", "1")
  45.     end tell
  46.     tell application "Eudora"
  47.         run
  48.     end tell
  49. end script
  50.  
  51. tell application "Finder"
  52.     try
  53.         set euFolder to folder "Eudora Folder" of system folder
  54.     on error
  55.         error "It seems Eudora is not installed in this computer."
  56.     end try
  57.     set alreadyinstalled to true
  58.     try
  59.         set auxFolder to folder "Eudora Share:Alt Settings" of system folder
  60.     on error
  61.         set alreadyinstalled to false
  62.     end try
  63. end tell
  64. if alreadyinstalled then
  65.     tell application "Finder"
  66.         display dialog "Eudora Share has already been installed on this computer." buttons {"OK"} default button "OK"
  67.     end tell
  68. else
  69.     tell application "Finder"
  70.         make new folder at system folder with properties {name:"Eudora Share"}
  71.         set euShareFolder to folder "Eudora Share" of system folder
  72.         make new folder at euShareFolder with properties {name:"Alt Settings"}
  73.         set euFolder to folder "Eudora Folder" of system folder
  74.         set altFolder to folder "Eudora Share:Alt Settings" of system folder
  75.         try
  76.             duplicate file "In.toc" of euFolder to altFolder
  77.             duplicate file "In" of euFolder to altFolder
  78.             duplicate file "Out.toc" of euFolder to altFolder
  79.             duplicate file "Out" of euFolder to altFolder
  80.             duplicate file "Eudora Settings" of euFolder to altFolder
  81.         on error
  82.             delete altFolder
  83.             error "It seems Eudora is not properly installed in this computer. Some files are missing in the Eudora Folder."
  84.         end try
  85.         repeat with currentFile in (altFolder)
  86.             copy the name of currentFile to nameFile
  87.             copy nameFile & " 2" to newNameFile
  88.             set name of currentFile to newNameFile
  89.         end repeat
  90.     end tell
  91.     set seu to (path to system folder as string) & "Eudora Share:switch Eudora"
  92.     store script switch in file seu
  93.     set s to (path to desktop as string)
  94.     set s1 to s & "Eudora 1"
  95.     store script e1 in file s1
  96.     set s2 to s & "Eudora 2"
  97.     store script e2 in file s2
  98.     display dialog "Installation completed successfully." buttons {"OK"} default button "OK"
  99. end if
  100.